﻿@model IList<ProductOverviewModel>
@using Nop.Web.Models.Catalog;
@if (Model.Count > 0)
{
    <div class="product-grid cross-sells clearfix" id="j-cross-sells-products">
        <div class="title">
            @T("ShoppingCart.CrossSells")
        </div>
        <div class="cross-sells-list clearfix">
            @foreach (var product in Model)
            {
                <div class="item-box">
                    @Html.Partial("_ProductBox", product)
                </div>
            }
        </div>
    </div>
    <script type="text/javascript">
        seajs.use("common/1.0.0/index", function (app) {
            app(function () {
                app("#j-cross-sells-products").on("click", ".product-box-add-to-cart-button", function (evt) {
                    evt.preventDefault();
                    var add2cartLink = app(this).data("addcartlink");
                    app.ajaxCart.addproducttocart_catalog(add2cartLink);
                });
            });
        });
    </script>
}